<template>
	<view>
		<view class="top_box">
			<img src="/static/img/icon4.png" class='msg_icon' @tap='msgInfo' alt="">
			<view class="avater_box" @tap="jump_personal">
				<view class="">
					<!-- 					<image class="avater"
						src="https://img1.baidu.com/it/u=3788399534,270513252&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=500"
						mode=""></image> -->
					<image class="avater"
						:src="user_list.avatar==''?'https://img1.baidu.com/it/u=3788399534,270513252&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=500':user_list.avatar"
						mode=""></image>
				</view>
				<view class="avater_box-right">
					<view class="name_">
						{{user_list.name}}
					</view>
					<view class="phone_">
						{{user_list.phonenumber}}
					</view>
				</view>
			</view>
			<view class="company">
				<image src="../../static/icon/icon1.png" mode=""></image>
				<text>所属公司</text>
			</view>
			<view class="belong"  @tap="jump_personal">
				<text>{{user_list.deptName}}</text>
				<image src="../../static/icon/icon2.png" mode=""></image>
			</view>
			<view class="score">
				<image src="../../static/icon/icon4.png" mode=""></image>
				<image src="../../static/icon/icon4.png" mode=""></image>
				<image src="../../static/icon/icon4.png" mode=""></image>
				<image src="../../static/icon/icon4.png" mode=""></image>
				<image src="../../static/icon/icon3.png" mode=""></image>
			</view>
		</view>

		<view class="function">
			<view class="function_item" @tap="jumpMywork">
				<view class="left_item">
					<image class="icon" src="../../static/img/icon5.png" mode=""></image>
					<text>工单中心</text>
				</view>
				<image class="arrow" src="../../static/icon/icon2.png" mode=""></image>
			</view>
			<button class="function_item btn_kefu" open-type="contact" bindcontact="handleContact"
				session-from="sessionFrom">
				<view class="left_item">
					<image class="icon" src="../../static/icon/icon5.png" mode=""></image>
					<text>联系客服</text>
				</view>
				<image class="arrow" src="../../static/icon/icon2.png" mode=""></image>
			</button>
			<view class="function_item" @tap="toUS">
				<view class="left_item">
					<image class="icon" src="../../static/icon/icon6.png" mode=""></image>
					<text>关于我们</text>
				</view>
				<image class="arrow" src="../../static/icon/icon2.png" mode=""></image>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				user_list: {}
			}
		},
		
		onLoad() {
			//获取工程师个人信息
			this.getengineer()
		},
		methods: {
			//我的工单列表
			jumpMywork(){
				uni.navigateTo({
					url:'../list_enter/list_enter'
				})
			},
			//消息中心
				
			msgInfo(){
				uni.navigateTo({
					url:'../news/news'
				})
			},
			//获取工程师个人信息
			getengineer() {
				this.$https.get("getEnginnerUserInfo", {
					Authorization: uni.getStorageSync('token') || ''
				}).then(res => {
					this.user_list = res.user
					
				})
			},
			/* 跳转到个人资料 */
			jump_personal() {
				uni.navigateTo({
					url: '../personal/personal?username=' + this.user_list.name
				})
			},
			//关于我们
			toUS() {
				uni.navigateTo({
					url: './About_us'
				})
			},
		}
	}
</script>

<style lang="scss" scoped>
	.msg_icon{
		width: 44rpx;
		height: 44rpx;
		position: absolute;
		right: 30rpx;
		bottom: 38rpx;
	}
	.btn_kefu {
		background-color: #FFFFFF;
		border: none;
	}

	.btn_kefu::after {
		border: none;
	}

	.left_item {
		display: flex;
		justify-content: space-between;
		align-items: center;
	}

	.arrow {
		width: 16rpx;
		height: 26rpx;
	}

	.icon {
		width: 44rpx;
		height: 44rpx;
		margin-right: 30rpx;
	}

	.function_item {
		font-size: 28rpx;
		padding: 46rpx 0 44rpx;
		display: flex;
		justify-content: space-between;
		align-items: center;
		border-bottom: 2rpx solid #EFEFEF;

	}

	.function {
		width: 100%;
		padding: 0 30rpx;
		box-sizing: border-box;
	}

	.score {

		image {
			width: 34rpx;
			height: 30rpx;
			margin-right: 12rpx;
		}

	}

	.belong {
		margin: 3rpx 0 4rpx;
		display: flex;
		justify-content: space-between;
		align-items: center;

		text {
			font-size: 32rpx;
			font-family: PingFangSC-Regular, PingFang SC;
			font-weight: 400;
			color: #FFFFFF;
		}

		image {
			width: 16rpx;
			height: 26rpx;
		}
	}

	.company {
		margin-top: 20rpx;

		image {
			width: 32rpx;
			height: 32rpx;
		}

		text {
			font-size: 28rpx;
			font-family: PingFangSC-Regular, PingFang SC;
			font-weight: 400;
			color: #A9B4FF;
			margin-left: 16rpx;
		}
	}

	.avater_box-right {
		display: flex;
		flex-direction: column;
		justify-content: space-between;
		padding: 5rpx 0;
		box-sizing: border-box;
	}

	.avater_box {
		font-size: 28rpx;
		font-family: PingFangSC-Regular, PingFang SC;
		font-weight: 400;
		color: #FFFFFF;
		display: flex;
	}

	.avater {
		width: 84rpx;
		height: 84rpx;
		border-radius: 50%;
		margin-right: 30rpx;
	}

	.name_ {}

	.phone_ {
		font-size: 28rpx;
		font-family: PingFangSC-Regular, PingFang SC;
		font-weight: 400;
		color: #A9B4FF;
	}

	.top_box {
		width: 100%;
		height: 360rpx;
		background: #4053CD;
		padding: 40rpx 30rpx 0;
		box-sizing: border-box;
		position: relative;
	}
</style>
